package com.atguigu.boot.controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * @author ：malichun
 * @date 2022/1/18 12:58 AM
 * @description：
 * @modified By：
 */
@RestController
public class HelloController {

    @RequestMapping("bug.jpg")
    public String hello(@RequestParam("username") String userName){
        return "aaaa";
    }

    // @RequestMapping(value="/user",method = RequestMethod.GET)
    @GetMapping(value = "/user")
    public String getUser(){
        return "GET-张三";
    }

    // @RequestMapping(value="/user",method = RequestMethod.POST)
    @PostMapping("/user")
    public String saveUser(){
        return "POST-张三";
    }

    @RequestMapping(value = "/user",method = RequestMethod.PUT)
    public String putUser(){
        return "PUT-张三";
    }

    @RequestMapping(value="/user",method = RequestMethod.DELETE)
    public String deleteUser(){
        return "DELETE-张三";
    }
}
